﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;

namespace SFJDManagement
{
	class IDateTimeColumn : DataGridBoundColumn
	{
		private int type = 0;

		public IDateTimeColumn(int type) : base()
		{
			this.type = type;
		}

		protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
		{
			throw new NotImplementedException();
		}

		protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem)
		{
			Binding bind = Binding as Binding;
			TextBox box = new TextBox();
			switch (type)
			{
				case 1:
					box.SetBinding(TextBox.TextProperty, new Binding() { Path = bind.Path, Mode = BindingMode.TwoWay, StringFormat = "yyyyMMdd" });
					break;
				case 2:
					box.SetBinding(TextBox.TextProperty, new Binding() { Path = bind.Path, Mode = BindingMode.TwoWay, StringFormat = "yyyyMMdd hhmm" });
					break;
			}
			return box;
			throw new NotImplementedException();
		}
	}
}
